<?php
namespace App\Actions\Admin;

use App\Actions\BaseAction;
use App\Models\Config;

class ConfigAction extends BaseAction
{
    public function save($inputs)
    {
        $inputs = collect($inputs)->only(['dy_end', 'ddb_first_end', 'ddb_second_end', 'ddb_time'])->all();
        foreach($inputs as $field => $value) {
            Config::query()->where('key', $field)->update(['value' => $value]);
        }
    }
}